﻿@model Mrc.Entity.SysUser
@{
    ViewData["Title"] = "Add";
    Layout = "~/Areas/Admin/Views/_Layout.cshtml";
    var Id = (ViewContext.HttpContext.Request.Query["Id"]).ToString();
}
<div style="margin-top:3em;margin-right:5em">
    <form class="layui-form" action="" id="formdata">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block">
                <input type="text" value="@Model.AccountName" placeholder="" autocomplete="off" class="layui-input" readonly>
                <input type="text" name="id" value="@Model.Id" placeholder="" autocomplete="off" class="layui-input layui-hide">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">新密码</label>
            <div class="layui-input-block">
                <input type="password" name="password" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">确认密码</label>
            <div class="layui-input-block">
                <input type="password" name="cpassword" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>

<script>
    //Demo
    layui.use('form', function () {
        var form = layui.form;
        form.on('submit(formDemo)', function (data) {
            BaseAjax(ajaxType.post, "/admin/user/UpdatePassword", data.field, function (repo)
            {
                if (repo.status == ajaxStatus.OK)
                    x_admin_close();
            });
            return false;
        });
    });
</script>

